package db.nio.test;

import db.nio.Processor;
import db.nio.ChannelContext;

/**
 * Created by root on 10/20/16.
 */
public class ClientProcessor implements Processor<DbResult>{
    @Override
    public void doProcessor(DbResult data, ChannelContext context) {
       if(data!= null){
           System.out.println("client read:"+data.getMessage().length());
       }
    }

    @Override
    public void doException(Throwable e, ChannelContext context) {
        System.out.println(e.getMessage());
       // if(context != null)
//            context.close();

    }

    @Override
    public void doClose(ChannelContext context) {
        System.out.println("close");
        context.close();
    }
}
